#include "department.h"
Department::Department(void)
{
	strcpy(m_strName,"hehe");
}
Department::Department(int id,const char* name,int num)
{
	m_iId = id;
	strcpy(m_strName,name);
	m_iNum = num;
}
Department::~Department(void)
{
}
void Department::setId(int id)
{
	m_iId = id;
}
void Department::setNum(int num)
{
	m_iNum = num;
}
void Department::setName(const char* name)
{
	strcpy(m_strName,name);
}
int Department::getId(void)
{
	return m_iId;
}
int Department::getNum(void)
{
	return m_iNum;
}
const char* Department::getName(void)
{
	return m_strName;
}
ostream& operator<<(ostream& os,const Department& dpm)
{
	os << dpm.m_iId << " " << dpm.m_strName << " " << dpm.m_iNum << endl;
	for(int i=0;i<dpm.m_iNum;i++)
	{
		os << dpm.empArr[i] << endl;
	}
	return os;
}
istream& operator>>(istream& is,Department& dpm)
{
	is >> dpm.m_iId >> dpm.m_strName >> dpm.m_iNum;
	for(int i=0;i<dpm.m_iNum;i++)
	{
		Employee* emp = new Employee;
		is >> *emp;
		dpm.empArr.push_back(*emp);
	} 
	return is;
}
